package com.zxp.cloud.storage.repository;

import com.zxp.cloud.storage.model.Storage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @author shollin
 * @desc
 * @date 2021/7/20/020 21:59
 */
public interface StorageRepository extends JpaRepository<Storage, Long>, JpaSpecificationExecutor<Storage> {

    @Query(value = " FROM Storage WHERE productId=:productId ")
    Storage findFirstByProductId(@Param("productId") Long productId);
}
